package com.test4;

import org.springframework.beans.factory.FactoryBean;

/**
 * Created by Admin on 9/17 0017.
 */
public class CarFactoryBean implements FactoryBean<Car> {
    private String brand;
    private double price;

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Car getObject() throws Exception {
        return new Car(brand,500000);
    }

    public Class<?> getObjectType() {
        return Car.class;
    }

    public boolean isSingleton() {
        return true;
    }
}
